/************************************************************************

								Heroes IV
					  Copyright 2000, The 3DO Company

	------------------------------------------------------------------
  						 qualified_adv_object_type.h

	$Header: /heroes4/qualified_adv_object_type.h $

	$NoKeywords: $

 ************************************************************************/

#if !defined( QUALIFIED_ADV_OBJECT_TYPE_H_INCLUDED )
#define QUALIFIED_ADV_OBJECT_TYPE_H_INCLUDED

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#include <iosfwd>

enum t_adv_object_type;

// ------------------------------------------------------------------------------
// t_qualified_adv_object_type class
// ------------------------------------------------------------------------------

class t_qualified_adv_object_type
{
public:
	// Constructors
	t_qualified_adv_object_type();
	t_qualified_adv_object_type( t_adv_object_type type, int major_subtype = 0, 
								 int minor_subtype = 0 );

	// Member functions
	t_adv_object_type get() const;
	int major_subtype() const;
	int minor_subtype() const;

	// Operator
	operator t_adv_object_type() const;

private:
	// Data members
	t_adv_object_type	m_type;
	int					m_major_subtype;
	int					m_minor_subtype;
};


inline t_adv_object_type t_qualified_adv_object_type::get() const
{
	return m_type;
}

inline int t_qualified_adv_object_type::major_subtype() const
{
	return m_major_subtype;
}

inline int t_qualified_adv_object_type::minor_subtype() const
{
	return m_minor_subtype;
}

inline t_qualified_adv_object_type::operator t_adv_object_type() const
{
	return m_type;
}

inline bool operator==( t_qualified_adv_object_type const & left, t_qualified_adv_object_type const & right )
{
	return left.get() == right.get() && left.major_subtype() == right.major_subtype() && left.minor_subtype() == right.minor_subtype();
}

inline bool operator!=( t_qualified_adv_object_type const & left, t_qualified_adv_object_type const & right )
{
	return !( left == right );
}

bool read( std::streambuf & stream, t_qualified_adv_object_type & qualified_type );

bool write( std::streambuf & stream, t_qualified_adv_object_type const & qualified_type );


#endif